package cn.edu.scau.cmi.chenyiqiu.composite.consistent;

import java.util.HashSet;
import java.util.Set;


public abstract class ConsistentOrganizationComponent {
	String say = "一致性模式";
	//组织或个人名称
	String name;
	//父节点
	ConsistentOrganizationComponent parent;
	//子节点集合
	Set<ConsistentOrganizationComponent> childrens = new HashSet<ConsistentOrganizationComponent> ();
	
	//------------------------------修改器、访问器------------------------------------------
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	
	public ConsistentOrganizationComponent getParent() {
		return parent;
	}

	public void setParent(ConsistentOrganizationComponent parent) {
		this.parent = parent;
	}

	public Set<ConsistentOrganizationComponent> getChildrens() {
		return childrens;
	}
	
	public String getSay() {
		return say;
	}
	
	//------------------------------方法------------------------------------------
	public abstract String say();
	
	public abstract void addChildren(ConsistentOrganizationComponent children);
	
	public abstract void deleteChildren(ConsistentOrganizationComponent children);
}
